import 'package:day3pm/enlargeImage.dart';
import 'package:flutter/material.dart';

class imgBox extends StatelessWidget {
  const imgBox({
    super.key,
    required this.width,
    required this.height,
    required this.color,
    required this.title,
    required this.imgString,
    required this.tag,
  });

  final double width;
  final double height;
  final Color color;
  final String title;
  final String imgString;
  final String tag;

  @override
  Widget build(BuildContext context) {
    return Container(
      width: width,
      height: height,
      child: Stack(
        children: [
          Image.asset(
            width: double.infinity,
            height: double.infinity,
            imgString,
            fit: BoxFit.cover,
          ),
          Container(
            width: double.infinity,
            height: double.infinity,
            color: color.withOpacity(.5),
          ),
          Center(
            child: Text(
              title,
              style: TextStyle(
                  fontSize: 24,
                  fontWeight: FontWeight.w800,
                  color: Colors.white),
            ),
          )
        ],
      ),
    );
  }
}

class PhotosBox extends StatelessWidget {
  const PhotosBox(
      {super.key,
      required this.width,
      required this.height,
      required this.imgString});

  final double width;
  final double height;
  final String imgString;

  @override
  Widget build(BuildContext context) {
    return Container(
      width: width,
      height: height,
      child: Image.asset(
        imgString,
        width: double.infinity,
        height: double.infinity,
        fit: BoxFit.cover,
      ),
    );
  }
}
